using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace TeamTime
{
    public partial class ActivitiesForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                this.DetailsView1.Visible = false;
            }
            this.SqlDataSource1.InsertParameters["UserIDModifiedBy"].DefaultValue = Session["UserID"].ToString();
            this.SqlDataSource1.UpdateParameters["UserIDModifiedBy"].DefaultValue = Session["UserID"].ToString();
        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
            this.DetailsView1.ChangeMode(DetailsViewMode.Insert);
            this.DetailsView1.Visible = true;
        }

        protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
        {
            this.DetailsView1.Visible = false;
        }

        protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            this.DetailsView1.Visible = false;
        }

        protected void DetailsView1_ModeChanged(object sender, EventArgs e)
        {
            this.DetailsView1.Visible = false;
        }
    }
}
